import { createRouter, createWebHistory } from 'vue-router';
import { staticRoutes } from '@/router/router';
import { whichPage } from '@/utils/tabberFun'

const router = createRouter({
	history: createWebHistory(),
	routes: staticRoutes,
  scrollBehavior() {
    return { top: 0, left: 0}
  },
})

router.beforeEach((to, from, next) => {
  // 判断当前路径,修改tabbar高亮
  whichPage(to.path)
  next()
})


// 导出路由
export default router;